<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06_JS函数</title>
</head>
<body>
<script>
    function f1(){
        console.log("f1被执行了");
    }
    f1();

    function f2(n){
        console.log("f2被执行了");
        console.log(n);
    }
    f2(100);
    f2('你好')
    f2(true)

    function f3(x,y){
        console.log("f3被执行了");
        console.log(x+y);
    }
    f3(100,200);
    f3(1,2,3,4)//1+2
    f3(1)//1+undefined=NaN

    function f4(x,y){
        console.log("f4被执行了");
        return x+y;
    }
    var res = f4(100,200);
    console.log(res);
    console.log(f4(1111,200));

    (function(){
        console.log("匿名函数被执行了");
    })();
    var f5 = function(){
        console.log("f5被执行了");
    }
    f5();
    console.log(f5);
    console.log(typeof f5)

    const f6 = () => {
        console.log("f6被执行了");
    }
    f6();
</script>
</body>
</html>